function generateConfirmTime(data) {
    if (!data.disposeTime) {
        data.disposeTime = "--:--"
    }
    switch (data.statu) {
        case 2:
            return '<span class="p_contime" style="color:#FF5722">' + data.disposeTime + '</span>'
            break;
        case 1:
            return '<span class="p_contime" style="color:black">' + data.disposeTime + '</span>'
            break;
        case 0:
            return '<span class="p_contime" style="color:grey">' + data.disposeTime + '</span>'
            break;
    }
};

function generateTime(data) {
    switch (data.statu) {
        case 2:
            return '<span class="p_time" style="color:#FF5722">' + data.answerTime + '</span>'
            break;
        case 1:
            return '<span class="p_time" style="color:black">' + data.answerTime + '</span>'
            break;
        case 0:
            return '<span class="p_time" style="color:grey">' + data.answerTime + '</span>'
            break;
    }
};


function generateFlowEvent(data) {
    if (data.LAY_INDEX == 1 && data.statu == 0) {
        return '<input type="text" class="flow_content" name="flow_test" value="' + data.flowName + '"/>'
    } else {
        switch (data.statu) {
            case 2:
                return '<span class="p_content" style="color:#FF5722">' + data.flowName + '</span>'
                break;
            case 1:
                return '<span class="p_content" style="color:black">' + data.flowName + ' </span>'
                break;
            case 0:
                return '<span class="p_content" style="color:grey">' + data.flowName + ' </span>'
                break;
        }
    }
}

function generateToolBar(data) {
    if (data.statu == 2) {
        return '<a class="layui-btn layui-btn-sm" lay-event="sure">确认</a>'
    } else {
        return '<a class="layui-btn layui-btn-sm" lay-event="sure" style="display:none">确认</a>'
    }
}

function alertMsg(msg) {
    layer.open({
        type: 1
        , offset: 'auto' //具体配置参考：http://www.layui.com/doc/modules/layer.html#offset
        , id: 'layerDemoauto' //防止重复弹出
        , content: '<div style="padding: 20px 100px;">' + msg + '</div>'
        , btn: '关闭'
        , btnAlign: 'c' //按钮居中
        , shade: 0 //不显示遮罩
        , yes: function () {
            // layer.close(layer.index);
            layer.closeAll('page');
        }
    });
}

function closeSonPage() {
    var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);//关闭当前页
}


var flowData = {
    faultId : "",
    tag : ""
};


function setFlowData(faultId,tag){
    localStorage.setItem("faultId",faultId);
    localStorage.setItem("tag",tag);
}

function getFlowData(){
    let flowData = {
        faultId : localStorage.getItem("faultId"),
        tag : localStorage.getItem("tag")
    }
    return flowData;
}








